{extend name='admin@main'}


{block name="content"}

<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off" id="Newform">
    <div class="layui-card-body padding-left-40">

		
        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">姓名</span>
                <span class="color-desc margin-left-5"></span>
					{if isset($vo) and isset($vo.name)}
					<input type="text" maxlength="20" autocomplete="off" required name="name" value='{$vo.name|default="-"}' readonly class="layui-input" >
					{else}
                    <select class="layui-select" lay-verify="required"  required name="name" lay-search id="name" lay-filter="name">
                        <option value="">请选择</option>
                        {foreach $list as $k=>$v}
                        {eq name='$vo.name' value='$v["nickname"].""'}
                        <option selected value="{$v["nickname"]}" readonly>{$v["nickname"]}</option>
                        {else}
                        <option value="{$v["nickname"]}">{$v["nickname"]}</option>
                        {/eq}
                        {/foreach}
                    </select>
					{/if}

            </label>

        </div>	
		
        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">年度</span>
                <span class="color-desc margin-left-5"></span>
                <select class="layui-select" name="years">
					<option value="">请选择</option>
                    {foreach ['2018','2019','2020','2021','2022'] as $k=>$v}
                    {eq name="$vo.years" value='$v.""'}
                    <option selected value="{$v}">{$v}</option>
                    {else}
                    <option value="{$v}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>

            </label>
        </div>



        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">年假</span>
                <span class="color-desc margin-left-5"></span>
                <input type="text" maxlength="20" autocomplete="off" required name="nianjia" value='{$vo.nianjia|default="0.0"}' placeholder="年假" class="layui-input" pattern="^[0-9]+(.[0|5]{1})?$" >
            </label>
        </div>
		
		
        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">已休天数</span>
                <span class="color-desc margin-left-5"></span>
                <input type="text" maxlength="20" autocomplete="off" required name="yixiunianjia" value='{$vo.yixiunianjia|default="0.0"}' placeholder="已休天数" class="layui-input" pattern="^[0-9]+(.[0|5]{1})?$" >
            </label>

        </div>
		

		

		
        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">备注</span>
                <span class="color-desc margin-left-5"></span>
                <textarea placeholder="请输入备注" class="layui-textarea" name="remark">{$vo.remark|default=""}</textarea>
            </label>
			<p class="color-desc"></p>
        </div>
			
		
		
    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

</form>
{/block}

{block name='script'}

<script src="__ROOT__/static/plugs/laydate/laydate.js"></script>
<script src="__ROOT__/static/plugs/select/xm-Select.js"></script>
<script>
    window.form.render();
    
    layui.use(['form', 'layedit', 'laydate','upload'], function(){
      var form = layui.form
      ,layer = layui.layer
      ,layedit = layui.layedit
      ,laydate = layui.laydate
	  ,upload = layui.upload;

	  upload.render({ //允许上传的文件后缀
		elem: '#file_attach'
		,url: '{:url("upload")}'
		,accept: 'file' //普通文件
		,exts: 'pdf|jpg|gif|doc|docx|zip|rar|7z' //只允许上传的文件
		,done: function(res, index, upload) {
		  console.log(res)
		  $("#files").attr("value", res.url);
		}
	  });



    });
</script>
{/block}